package main

import (
	"fmt"
	"github.com/astaxie/beego/httplib"
	"github.com/golang/protobuf/proto"
	"study/grpc/artcile/noticesmsg"
	"time"
)

const (
	address     = "https://service.yungengxin.com/v1/lowerHair/noticeList?limit=3&time=1531817284&sign=0ee1f9bbf48e68420c66816611254add"
	address1     = "https://service.yungengxin.com/v1/lowerHair/noticeList?limit=3&time=1531901654&sign=17d5c11ea4111a8b92f818f4636d51d8"
)

func main()  {
	req := httplib.Get(address1).SetTimeout(3*time.Second, 10*time.Second)
	resByte,err:= req.Bytes()
	if err != nil {
		panic(err)
	}
	var msg noticesmsg.NoticesMsg
	proto.Unmarshal(resByte, &msg)

	fmt.Println(len(msg.Vnotice))
	fmt.Println(msg.Vnotice)
}